package com.cn.march.base.service;

import java.io.Serializable;

import com.cn.march.base.dao.BaseMapper;

public class BaseServiceImpl<T> implements BaseService<T> {

	private BaseMapper<T> baseMapper;
	
	public BaseMapper<T> getBaseMapper() {
		return baseMapper;
	}

	public void setBaseMapper(BaseMapper<T> baseMapper) {
		this.baseMapper = baseMapper;
	}

	public T selectById(Serializable id) {

		return baseMapper.selectByPrimaryKey(id);
	}

	public int insert(T model) {

		return baseMapper.insertSelective(model);
	}

	public int update(T model) {

		return baseMapper.updateByPrimaryKey(model);
	}

	public int deleteById(Serializable id) {

		return baseMapper.deleteByPrimaryKey(id);
	}

}
